const obj = {x: 1, y: 2}

type A = {a: number}
type B = {a: number, b: number}
// const a: A = {a: 1, b: 2} // 报错：对象字面量只能指定已知属性，并且“b”不在类型“A”中

class Animal {
  name: string
  constructor(name: string) {
    this.name = name
  }
}

class Dog extends Animal {
  constructor(name: string, public category: string) {
    super(name)
  }
}

const dog = new Dog('旺财', '泰迪')
console.log(dog.name, dog.category)
const ani: Animal = dog
console.log(ani)

export {}